package org.yys.consumer.listener;

import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.support.RocketMQConsumerLifecycleListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "fastTopic",consumerGroup = "fast-consumer-group")
public class FastConsumer implements RocketMQListener<Message> {

    @Override
    public void onMessage(Message message) {
        String s = new String(message.getBody());
        System.out.println("接收到消息:"+s);
    }
}
